{extend name="iframe" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <button type="button" class="layui-btn layui-btn-normal layui-btn-position scholarImport"><i class="fa fa-file-o"></i> 请选择文件导入</button>
    </div>
</div>
{/block}
{block name="js"}
<script>
    upload.render({
        elem: '.scholarImport',
        url: '/admin/scholar/importScholar',
        accept: 'file', // 普通文件
        done: function (result) {
            // 上传完毕回调
            if (result.code === 1) {
                layer.msg("导入成功");
                parent.location.href = result.url;
            } else {
                if (result.msg == null || result.msg === '' || result.msg === '未知错误') {
                    layer.msg("导入成功");
                    parent.location.href = result.url;
                } else {
                    layer.msg(result.msg);
                }
            }
        }
    });
</script>
{/block}